/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.classnet.db;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author karltinawi
 */
@Entity
@Table(name = "accRequest")
@NamedQueries({@NamedQuery(name = "AccRequest.findByUser", query = "SELECT a FROM AccRequest a WHERE a.user = :user"), @NamedQuery(name = "AccRequest.findByCode", query = "SELECT a FROM AccRequest a WHERE a.code = :code")})
public class AccRequest implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "user", nullable = false)
    private String user;
    @Column(name = "code", nullable = false)
    private String code;

    public AccRequest() {
    }

    public AccRequest(String user) {
        this.user = user;
    }

    public AccRequest(String user, String code) {
        this.user = user;
        this.code = code;
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (user != null ? user.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AccRequest)) {
            return false;
        }
        AccRequest other = (AccRequest) object;
        if ((this.user == null && other.user != null) || (this.user != null && !this.user.equals(other.user))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.classnet.db.AccRequest[user=" + user + "]";
    }

}
